<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var num = [1, 2, 4, 5, 6, 7];
        var arr = [];
        function push1(a) {
            for (let i = 0; i < arguments.length; i++) {

                a[a.length] = arguments[i];
            }
        }
        push1(num, 14, "你好");
        console.log(num);

        push1(arr, 15);
        console.log(arr);

        Array.prototype.push2 = function () {
            for (let i = 0; i < arguments.length; i++) {
                this[this.length] = arguments[i];

            }
        }
        num.push2("a", "n", "f");
        console.log(num);
        arr.push2("a", "n", "f");
        console.log(arr);


        /*    function push(num, arr) {
          num[num.length] = arr;
          return num;
      }
      console.log(num.push('虞姬', '吕布', 21), num);
*/

        /*
         for (let i = 0; i < 10; i++) {
             arr[i] = i + 1;
 
         }
 
 
         console.log(arr); 
         
         
         function splice() {
 
             console.log(num.splice(2, 4));
         }
         splice();
         num[2] = 10;
         console.log(num); */
    </script>
</body>

</html>